package com.miplus.ccrm.core.mapper;

import com.github.yulichang.base.MPJBaseMapper;
import com.miplus.ccrm.core.controller.vo.conf.IouSelectProductResVo;
import com.miplus.ccrm.core.pojo.IouProduct;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author Yaohui
* @description 针对表【iou_product】的数据库操作Mapper
* @createDate 2024-11-04 09:45:42
* @Entity com.miplus.ccrm.core.pojo.IouProduct
*/
@Mapper
public interface IouProductMapper extends MPJBaseMapper<IouProduct> {

    @Select("SELECT id AS `value`,CONCAT(product_name,if(merchant_name IS NULL ,'',CONCAT('(',merchant_name,')'))) AS label FROM iou_product ")
    List<IouSelectProductResVo> selectProduct();
    @Select("SELECT merchant_name AS `value`,merchant_name AS label FROM iou_product  WHERE merchant_name!='' GROUP BY merchant_name ")
    List<IouSelectProductResVo> selectMerchant();
}




